package com.qdc.datacenters.config.mybatis;

import com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor;
import com.qdc.datacenters.handler.QscDataPermissionHandler;
import com.qdc.datacenters.interceptor.QdcDataPermissionInterceptor;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author danmo
 * @description mybatis拦截器相关配置
 * @date 2023/5/31 11:18
 **/
@Configuration
public class MybatisPlusConfig {

    @Bean
    public MybatisPlusInterceptor mybatisPlusInterceptor() {
        MybatisPlusInterceptor interceptor = new MybatisPlusInterceptor();
        interceptor.addInnerInterceptor(new QdcDataPermissionInterceptor(new QscDataPermissionHandler()));
        return interceptor;
    }
}
